<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>订单查询</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			$(":input").prop("disabled", true);
			$(":button").prop("disabled", true);
			$(":submit").prop("disabled", true);
			$("select").prop("disabled", true);
			$("#btnCancel").prop("disabled", false);
			if($("#day").val()==0){
				$("#day").val("0.5");
			}
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li ><a href="${ctx}/orders/tOrders/allOrderList">订单一览</a></li>
		<shiro:hasPermission name="orders:tOrders:view"><li class="active"><a href="${ctx}/orders/tOrders/form?id=${tOrders.orderid}">订单查询</a></li></shiro:hasPermission>
	</ul>
	<br/>
	<form:form id="viewForm" modelAttribute="tOrders" class="form-horizontal">
		<form:hidden path="id"/>
		<sys:message content="${message}"/>		
		<div class="control-group">
			<label class="control-label">订单号：</label>
			<div class="controls">
				<form:input path="orderid" htmlEscape="false" class="span4 digits" />
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">订单名称：</label>
			<div class="controls">
				<form:input path="ordername" htmlEscape="false" class="span4" />
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">订单日期：</label>
			<div class="controls">
				<input id='createDate' name='createDate' type='text' class="span4"
							value ='<fmt:formatDate value="${tOrders.createDate }" pattern="yyyy-MM-dd HH:mm:ss"/>'/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">订单状态：</label>
			<div class="controls">
				<form:select path="orderstatus" class="span4 required">
					<form:options items="${fns:getDictList('orderstatus')}"
						itemLabel="label" itemValue="value" htmlEscape="false" />
				</form:select>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">订单金额：</label>
			<div class="controls">
				<input type="number" class="span4" value ='${tOrders.dueamount }'/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">出发地：</label>
			<div class="controls">
				<input type='text' class="span4" value ='${tOrders.departcity }'/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">目的地：</label>
			<div class="controls">
				<input type='text' class="span4" value ='${tOrders.destcity}'/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">上(下)车地点：</label>
			<div class="controls">
				<input type='text' class="span4" value ='${tOrders.boardaddr }'/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">出发时间：</label>
			<div class="controls">
				<input type='text'
					value='<fmt:formatDate value="${tOrders.departdate}" pattern="yyyy-MM-dd HH:mm:ss"/>'
					class="span4" />
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">包车天数：</label>
			<div class="controls">
				<form:input path="bookingdays" htmlEscape="false" class="span4" id="day"/> 
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">车辆数：</label>
			<div class="controls">
				<form:input path="purchasenum" htmlEscape="false" class="span4" />
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">车型：</label>
			<div class="controls">
				<input type='text' readonly value="${tOrders.cartype.typename}"
					class="span4" />
					<c:if test="${tOrders.ordertype eq 'c' && not empty tOrders.realsche.typeremarks}">
				(${tOrders.realsche.typeremarks})
				</c:if>
			</div>	
		</div>
		<div class="control-group">
			<label class="control-label">品牌：</label>
			<div class="controls">
				<input type='text' readonly value="${tOrders.cartype.typedesc}"
					class="span4" />
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">联系人姓名：</label>
			<div class="controls">
				<form:input path="contacts" htmlEscape="false" class="span4" />
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">联系人电话：</label>
			<div class="controls">
				<form:input path="payertel" htmlEscape="false" class="span4" />
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">行程备注：</label>
			<div class="controls">
		  <c:choose>
			<c:when test="${tOrders.ordertype eq 'c'}">
				<textarea  readonly style="width:280px;height:100px;">${tOrders.realsche.modeldesc}&#13;&#10;${tOrders.remarks}</textarea>
			</c:when>
			<c:otherwise>
				<textarea  readonly style="width:280px;height:100px;">${tOrders.remarks}</textarea>
			</c:otherwise>
			</c:choose>
			</div>
		</div>
		<c:if test="${tOrders.ordertype eq '7'}">
			<div class="control-group">
			<label class="control-label">客户名称：</label>
			<div class="controls">
				<input name="clientname" type='text' readonly value=${tOrders.clientname }  />
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">业务员：</label>
			<div class="controls">
				<input name="merchandiser" type='text' readonly value=${tOrders.merchandiser } />
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">是否包含路杂费：</label>
			<div class="controls">
				<input name="roadfees" type="radio"  readonly <c:if test="${tOrders.roadfees eq '1'}">checked="checked"</c:if> />&nbsp;是&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<input name="roadfees" type="radio"  readonly <c:if test="${tOrders.roadfees eq '0'}">checked="checked"</c:if> />&nbsp;否
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">是否含油：</label>
			<div class="controls">
				<input name="oil" type="radio" readonly  <c:if test="${tOrders.oil eq '1'}">checked="checked"</c:if> />&nbsp;是&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<input name="oil" type="radio" readonly  <c:if test="${tOrders.oil eq '0'}">checked="checked"</c:if> />&nbsp;否
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">是否包含驾驶员住宿：</label>
			<div class="controls">
				<input name="driverlodge" type="radio" readonly <c:if test="${tOrders.driverlodge eq '1'}">checked="checked"</c:if> />&nbsp;是&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<input name="driverlodge" type="radio" readonly <c:if test="${tOrders.driverlodge eq '0'}">checked="checked"</c:if> />&nbsp;否
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">是否含税：</label>
			<div class="controls">
				<input name="tax" type="radio" readonly <c:if test="${tOrders.tax eq '1'}">checked="checked"</c:if> />&nbsp;是&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<input name="tax" type="radio" readonly <c:if test="${tOrders.tax eq '0'}">checked="checked"</c:if> />&nbsp;否
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">现收：</label>
			<div class="controls">
				<input name="nowpay" type='text' readonly value=${tOrders.nowpay } />
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">定金：</label>
			<div class="controls">
				<input name="downpay" type='text' readonly value=${tOrders.downpay } />
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">挂账：</label>
			<div class="controls">
				<input name="ownpay" type='text' readonly value=${tOrders.ownpay } />
			</div>
		</div>
		<%-- <div class="control-group">
		<label class="control-label">支付方式：</label>
			<div class="controls">
				<textarea  readonly style="width:280px;height:100px;">${tOrders.orderRemarks}</textarea>
			</div>
		</div> --%>
		</c:if>
		<c:if test="${tOrders.ordertype eq '2'}">
			
		<div class="control-group">
			<label class="control-label">是否包含路杂费：</label>
			<div class="controls">
				<input name="roadfees" type="radio"  readonly  checked="checked"/>&nbsp;是&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<input name="roadfees" type="radio"  readonly  />&nbsp;否
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">是否含油：</label>
			<div class="controls">
				<input name="oil" type="radio" readonly   />&nbsp;是&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<input name="oil" type="radio" readonly  checked="checked" />&nbsp;否
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">是否包含驾驶员住宿：</label>
			<div class="controls">
				<input name="driverlodge" type="radio" readonly checked="checked" />&nbsp;是&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<input name="driverlodge" type="radio" readonly  />&nbsp;否
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">是否含税：</label>
			<div class="controls">
				<input name="tax" type="radio" readonly  />&nbsp;是&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<input name="tax" type="radio" readonly checked="checked" />&nbsp;否
			</div>
		</div>
		<%-- <div class="control-group">
		<label class="control-label">支付方式：</label>
			<div class="controls">
				<textarea  readonly style="width:280px;height:100px;">${tOrders.orderRemarks}</textarea>
			</div>
		</div> --%>
		</c:if>
		<c:if test="${tOrders.ordertype eq '5' || tOrders.ordertype eq '6' || tOrders.ordertype eq 'c' }">
			
		<div class="control-group">
			<label class="control-label">是否包含路杂费：</label>
			<div class="controls">
				<input name="roadfees" type="radio"  readonly  checked="checked"/>&nbsp;是&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<input name="roadfees" type="radio"  readonly  />&nbsp;否
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">是否含油：</label>
			<div class="controls">
				<input name="oil" type="radio" readonly   checked="checked"/>&nbsp;是&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<input name="oil" type="radio" readonly   />&nbsp;否
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">是否包含驾驶员住宿：</label>
			<div class="controls">
				<input name="driverlodge" type="radio" readonly  />&nbsp;是&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<input name="driverlodge" type="radio" readonly  checked="checked"/>&nbsp;否
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">是否含税：</label>
			<div class="controls">
				<input name="tax" type="radio" readonly  checked="checked" />&nbsp;是&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<input name="tax" type="radio" readonly  />&nbsp;否
			</div>
		</div>
		<%-- <div class="control-group">
		<label class="control-label">支付方式：</label>
			<div class="controls">
				<textarea  readonly style="width:280px;height:100px;">${tOrders.orderRemarks}</textarea>
			</div>
		</div> --%>
		</c:if>
		<div class="form-actions">
			<a class="btn btn-default" onclick="history.go(-1)">返&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;回</a>
			<c:if test="${tOrders.orderstatus == 0 &&tOrders.ordertype ne '5'}">
				<a class="btn btn-primary" href="${ctx}/orders/tOrders/changebus?id=${tOrders.orderid}" onclick="return confirmx('确认要更换车队?', this.href)">更换车队</a>
				<a class="btn btn-warning" href="${ctx}/orders/tOrders/breakbus?id=${tOrders.orderid}" onclick="return confirmx('确认要车队违约?', this.href)">车队违约</a>
				<a class="btn btn-warning" href="${ctx}/orders/tOrders/platback?id=${tOrders.orderid}" onclick="return confirmx('确认要平台退单?', this.href)">平台退单</a>
			</c:if>
		</div>
	</form:form>
</body>
</html>